<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Fangattr extends Basc
{
    protected $appends = ["action"];
    public function getActionAttribute(){
        $html = $this->editBtn("admin.fangattr.edit","修改",$this);
        $html .= " " . $this->deleteBtn("admin.fangattr.destroy","删除",$this);
        return $html;
    }
    public function setFieldNameAttribute(){
        $this->attributes["field_name"] = !empty(request()->get("field_name")) ? request()->get("field_name") : "";
    }
    public function setIconAttribute(){
        $this->attributes["icon"] = !empty(request()->get("icon")) ? request()->get("icon") : "";
    }
}
